<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>8 模板语法-指令</title>
    <script src="js/vue.global.js"></script>
    <script src="https://unpkg.com/vue-router@4"></script>
</head>
<body>
<div id = "app"></div>
<script type = "text/javascript">
    // 定义混入对象
    const myMixin = {
        created() {
            this.hello()
        },
        methods: {
            hello() {
                document.write('欢迎来到混入实例-RUNOOB!')
            }
        }
    }

    // 定义一个应用，使用混入
    const app = Vue.createApp({
        mixins: [myMixin]
    })

    app.mount('#app') // => "欢迎来到混入实例-RUNOOB!"
</script>
</body>
</html>